<template>
  <div>
    <el-header style="text-align: right; font-size: 14px">
      <span style="padding: 0 15px">{{ role }}</span>
      <el-dropdown @command="handleCommand">
        <i class="el-icon-caret-bottom"></i>
        <!-- <i class="el-icon-setting" style="margin-right: 15px"></i> -->
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item command="1"
            ><i class="el-icon-user" />个人中心</el-dropdown-item
          >
          <el-dropdown-item command="2"
            ><i class="el-icon-arrow-left" />退出系统</el-dropdown-item
          >
        </el-dropdown-menu>
      </el-dropdown>
    </el-header>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  methods: {
    handleCommand(command) {
      // this.$message("click on item " + command);
      if (command == "1") {
        this.$router.push("/admin/gl/glmima");
      } else {
        this.$router.push("/login");
        sessionStorage.clear();
      }
    },
  },
  computed: {
    ...mapGetters(["role"]),
  },
};
</script>

<style lang="scss" scoped>
@import "./scss/index.scss";
</style>